<?php
/* @var $this CompanyController */
/* @var $model Company */

$this->breadcrumbs=array(
	'Companies'=>array('index'),
	$model->title=>array('view','id'=>$model->id),
	'loginTemplates',
);
 
?>  
<script type="text/javascript">
    $(document).ready(function(e) {
      
    if(<?php echo isset($message)?"true":"false" ?> ){ 
       setTimeout(function(){$('.phonesview').click()},500) ;
    }

     $("#computers").click(function(){ 
        var template=$('#template').val();  
         $("#computers").colorbox({
            href:"<?php echo Yii::app()->createUrl('company/preview&type=computer&companyid='.$model->id.'&template=')?>"+template,
            close: "【关闭】",
            initialWidth:960,
            initialHeight:700,
            width:'960px',
            height:'700px',
            title:"预览电脑模板" 
           }); 
        });  

      $("#phones").click(function(){
        var template=$('#template').val(); 
         $("#phones").colorbox({
            href:"<?php echo Yii::app()->createUrl('company/preview&type=phone&companyid='.$model->id.'&template=')?>"+template,
            close: '【关闭】',
            initialWidth:440,
            initialHeight:878,
            width:'440px',
            height:'878px',
            title:"预览手机模板" 
           }); 
        });  
    }); 
</script>
<h1>修改用户登陆模板</h1> 

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
    'id'=>'company-form',
    'enableAjaxValidation'=>false, 
)); ?> 
    <p style="color: red;font-size: 14px;"> <?php echo empty($message)?'':''.$message; ?></p>  

    <div class="row"> 
        <?php echo $form->labelEx($model,'template'); ?>
            <?php echo $form->dropDownList(
                  $model,
                  'template', 
                  CHtml::listData(
                   $templates,
                    'id',
                    'title'
                ),array('id'=>'template')
            ); ?> 
          <?php echo CHtml::button('电脑预览',array('id'=>'computers')); ?>
          <?php echo CHtml::button('手机预览',array('id'=>'phones')); ?>
    </div>
 

    <div class="row buttons">
        <?php echo CHtml::submitButton($model->isNewRecord ? '新增' : '修改',array('class'=>'subButton')); ?>
    </div>

<?php $this->endWidget(); ?>

</div><!-- form -->